package com.action;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;

import com.dao.CommonDAO;
import com.dao.SysuserDAO;
import com.model.Familyda;
import com.model.Notice;
import com.model.Sysuser;
import com.opensymphony.xwork2.ActionSupport;
import com.util.Info;
import com.util.Pagination;

public class FamilydaAction extends ActionSupport
{
	private Integer id;
	private String fno;
	private String hz;
	private String ftype;
	private String rs;
	private String addr;
	private String ysid;
	private String hgid;
	private String unit;
	private String remark;
	private String delstatus;
	private int index=1;
	String no;
	String suc;
	private String utype;
	private CommonDAO commonDAO;
	
	
	
	
	public String getYsid() {
		return ysid;
	}
	public void setYsid(String ysid) {
		this.ysid = ysid;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getFno() {
		return fno;
	}
	public void setFno(String fno) {
		this.fno = fno;
	}
	public String getHz() {
		return hz;
	}
	public void setHz(String hz) {
		this.hz = hz;
	}
	public String getFtype() {
		return ftype;
	}
	public void setFtype(String ftype) {
		this.ftype = ftype;
	}
	public String getRs() {
		return rs;
	}
	public void setRs(String rs) {
		this.rs = rs;
	}
	public String getAddr() {
		return addr;
	}
	public void setAddr(String addr) {
		this.addr = addr;
	}
	public String getHgid() {
		return hgid;
	}
	public void setHgid(String hgid) {
		this.hgid = hgid;
	}
	public String getUnit() {
		return unit;
	}
	public void setUnit(String unit) {
		this.unit = unit;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getDelstatus() {
		return delstatus;
	}
	public void setDelstatus(String delstatus) {
		this.delstatus = delstatus;
	}
	public int getIndex() {
		return index;
	}
	public void setIndex(int index) {
		this.index = index;
	}
	public String getNo() {
		return no;
	}
	public void setNo(String no) {
		this.no = no;
	}
	public String getSuc() {
		return suc;
	}
	public void setSuc(String suc) {
		this.suc = suc;
	}
	public String getUtype() {
		return utype;
	}
	public void setUtype(String utype) {
		this.utype = utype;
	}
	public CommonDAO getCommonDAO() {
		return commonDAO;
	}
	public void setCommonDAO(CommonDAO commonDAO) {
		this.commonDAO = commonDAO;
	}
	//添加
	public String FamilydaAdd(){
		
		  	Familyda familyda = new Familyda();
		  	familyda.setFno(Info.getAutoId());
		  	familyda.setHz(hz);
		  	familyda.setFtype(ftype);
		  	familyda.setRs(rs);
		  	familyda.setAddr(addr);
		  	familyda.setYsid(ysid);
		  	familyda.setHgid(hgid);
		  	familyda.setUnit(unit);
		  	familyda.setRemark(remark);
		  	familyda.setDelstatus("0");
			commonDAO.save(familyda);
			suc="";
			return "success";
	}
	//编辑
	public String FamilydaEdit(){
		Familyda familyda = (Familyda)commonDAO.findById(id, "Familyda");
		familyda.setHz(hz);
	  	familyda.setFtype(ftype);
	  	familyda.setRs(rs);
	  	familyda.setAddr(addr);
	  	familyda.setYsid(ysid);
	  	familyda.setHgid(hgid);
	  	familyda.setUnit(unit);
	  	familyda.setRemark(remark);
		commonDAO.update(familyda);
		id = id;
		suc="";
		return "success";
	}
}
